package cn.btks.resultintegration.rule.service.impl;

import cn.btks.resultintegration.rule.pojo.EnvironmentSensitive;
import cn.btks.resultintegration.rule.repository.EnvironmentSensitiveRepository;
import cn.btks.resultintegration.rule.service.EnvironmentSensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

/**
 * @Author lijun
 * @Date 2021/2/23 10:21
 */
@Service
public class EnvironmentSensitiveServiceImpl implements EnvironmentSensitiveService {

    @Autowired
    EnvironmentSensitiveRepository environmentSensitiveRepository;

    @Override
    public List<EnvironmentSensitive> findAll() {
        return environmentSensitiveRepository.findAll();
    }

    @Override
    public EnvironmentSensitive findById(Long id) {
        Optional<EnvironmentSensitive> optional = environmentSensitiveRepository.findById(id);
        if(optional.isPresent()){
            return optional.get();
        }
        return null;
    }
}
